<template>
  
    <header>
      <van-search
        v-model="value"
        show-action
        label=""
        placeholder="请输入搜索名称"
        @search="onSearch"
        
      >
        <template #left>
          <van-icon name="arrow-left" @click="onSearchh" />
        </template>
        <template #action>
          <van-icon size="30px" name="manager-o" />
        </template>
      </van-search> 
     
    </header>
    <!-- <List /> -->
    <van-card v-for="item in list"
    :key="item.id"
  
  :title="item.title"
  :price="item.price"
  :thumb="item.image"
/>
</template>

<script setup>
// import List from "../home/list.vue";
import request from "@/uitle/request";
import { ref } from "vue";
import router from "@/router";
const value = ref("");
const onSearchh = () => {
    router.push('/')
};

const list = ref([]);
request.get("/list", {
    params: { pagination: 1, pageNum: 30 },
  })
  .then((res) => {
    if(res.data.code==200){
        console.log(res);
        list.value=res.data.data
    }
  });
</script>

<style lang="scss" scoped>
</style>